function curb65calc(conf, urea, resp, bp, age){

var curb65core=0;
var action ="consider a short stay in hospital or watch very closely as an outpatient";
var mortality="";  //from pneumonia

if (conf){conf=1;}else{conf=0;}
if (urea){urea=1;}else{urea=0;}
if (resp){resp=1;}else{resp=0;}
if (bp){bp=1;}else{bp=0;}
if (age){age=1;}else{age=0;}


curb65score = age + bp + resp + urea + conf;


if (curb65score ==0) {mortality= "0.7%";}
if (curb65score ==1) {mortality = "3.2%";}
if (curb65score ==2){mortality = "13.0%";}
if (curb65score ==3) {mortality = "17.0%";}
if (curb65score ==4) {mortality = "41.5%";}
if (curb65score == 5) {mortality = "57.0%";}

if (curb65score <2) {action= "treat as an outpatient";}
if (curb65score >2) {action= "hospitalization with consideration as to whether they need to be in ITU";}


return {
			 curb65score:curb65score,
			 mortality:mortality,
			 action:action
	};		 
}


var def1="<strong>Risk factors for CAD :</strong><ul><li>Family history of CAD</li><li>Hypertension</li><li>Hypercholesterolemia</li><li>Diabetes</li><li>Current Smoker</li></ul>";
var def2="<strong>Elevated Cardiac markers:</strong> <br />CK MB and/or cardiac specific troponin level";




function ref(){
// display reference
 return "<a href='http://www.aafp.org/fpm/20060400/41outp.html'>AAFP: Outpatient vs. Inpatient Treatment of Community-Acquired Pneumonia</a>";
}

function help() {
	return "AMT = Abbreviated Mental Test. Assess using AMT module in PreMedi";
}
